package kr.lgh.ex_baldojang.example;

import kr.lgh.ex_baldojang.R;
import android.app.Activity;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;

public class AdapterViewEx extends Activity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.adapter_btn);
		
	}
	
	public void mOnClick(View v){
		Button btn = null;
		RelativeLayout rel = (RelativeLayout)View.inflate(AdapterViewEx.this, R.layout.newmessage, null);
		RelativeLayout rel_img = (RelativeLayout)View.inflate(AdapterViewEx.this, R.layout.new_image, null);
		RelativeLayout rel_weather = (RelativeLayout)View.inflate(AdapterViewEx.this, R.layout.new_weather, null);
		LinearLayout linear = (LinearLayout)findViewById(R.id.linear);
		
		switch(v.getId()){
		
		case R.id.btn_picture:
			btn = (Button)findViewById(R.id.btn_picture);
			rel.setBackgroundColor(Color.GRAY);
			linear.addView(rel);
			break;
			
		case R.id.btn_gps:
			btn = (Button)findViewById(R.id.btn_gps);
			rel.setBackgroundColor(Color.YELLOW);
			linear.addView(rel_img);
			break;
			
		case R.id.btn_weather:
			btn = (Button)findViewById(R.id.btn_weather);
			rel.setBackgroundColor(Color.RED);
			linear.addView(rel_weather);
			break;
		}
		//linear.addView(rel);
	}
	
}
